import React, { Component } from 'react'
import { Breadcrumb } from 'antd'
import style from './style.less'

const Item = Breadcrumb.Item
export default class extends Component {
  render() {
    const { title, children } = this.props
    return (
      <div className={style.root}>
        <header className={style.title}>
          {Array.isArray(title) ? (
            <Breadcrumb>
              {title.map((item, i) => <Item key={i}>{item}</Item>)}
            </Breadcrumb>
          ) : (
            title
          )}
        </header>
        <div className={style.content}>{children}</div>
      </div>
    )
  }
}
